import {
	createRouter,
	createWebHistory,
	createWebHashHistory,
} from 'vue-router'

const routerHistory = createWebHashHistory()
// 定义路由
const routes = [{
		path: '/',
		redirect: '/home/Index',
	},
	{
		path: '/home',
		name: 'home',
		component: () => import('@/view/Home.vue'),
		children: [{
				path: 'index',
				name: 'index',
				component: () => import('@/components/Index.vue'),
			},
			{
				path: 'StudyCenter',
				name: 'StudyCenter',
				component: () => import('@/components/StudyCenter.vue'),
			},
			{
				path: 'Speech',
				name: 'Speech',
				component: () => import('@/components/Speech.vue'),
			},
			{
				path: 'SpeechMockExam',
				name: 'SpeechMockExam',
				component: () => import('@/components/SpeechMockExam.vue'),
			},
			{
				path: 'SpeackPractice',
				name: 'SpeackPractice',
				component: () => import('@/components/SpeackPractice.vue'),
			},
			{
				path: 'WhriteTopic',
				name: 'WhriteTopic',
				component: () => import('@/components/WhriteTopic.vue'),
			},
			{
				path: 'WritingQuestion',
				name: 'WritingQuestion',
				component: () => import('@/components/WritingQuestion.vue'),
			},
			{
				path: 'WriteTest',
				name: 'WriteTest',
				component: () => import('@/components/WriteTest.vue'),
			},
			{
				path: 'ModelEssay',
				name: 'ModelEssay',
				component: () => import('@/components/ModelEssay.vue'),
			},
			{
				path: 'MockListening',
				name: 'MockListening',
				component: () => import('@/components/mock/listening.vue'),
			},
			{
				path: 'ReferenceQuestion',
				name: 'ReferenceQuestion',
				component: () => import('@/components/ReferenceQuestion.vue'),
			},
			{
				path: 'TestQuestions',
				name: 'TestQuestions',
				component: () => import('@/components/TestQuestions.vue'),
			},
			{
				path: 'ListeningPractice',
				name: 'ListeningPractice',
				component: () => import('@/components/ListeningPractice.vue'),
			},
			{
				path: 'ReadA',
				name: 'ReadA',
				component: () => import('@/components/ReadA.vue'),
			},
			{
				path: 'ReadG',
				name: 'ReadG',
				component: () => import('@/components/ReadG.vue'),
			},
			{
				path: 'ReadTrueA',
				name: 'ReadTrueA',
				component: () => import('@/components/ReadTrueA.vue'),
			},
			{
				path: 'ReadTest',
				name: 'ReadTest',
				component: () => import('@/components/ReadTest.vue'),
			},
			{
				path: 'PackageA',
				name: 'PackageA',
				component: () => import('@/components/PackageA.vue'),
			},
			{
				path: 'ThreePackageA',
				name: 'ThreePackageA',
				component: () => import('@/components/ThreePackageA.vue'),
			},
			{
				path: 'login',
				name: 'login',
				component: () => import('@/components/Login.vue'),
			},
		],
	},
	{
		path: '/Login', // 登录界面
		name: 'Login',
		component: () => import('@/components/Login.vue'),
		children: [],
	},
	{
		path: '/MockListening',
		name: 'MockListening',
		component: () => import('@/components/mock/listening.vue'),
	},
]

// 创建路由器
const router = createRouter({
	history: routerHistory,
	routes: routes,
})

export default router